using System;

namespace NetBpm.Workflow.Delegation
{
	/// <summary> performs (de)serialisation of {@link NetBpm.Workflow.Execution.IAttributeInstance}-values (which are ordinary java-objects), for storage in the database.
	/// It is even possible to use a process specific java-type as {@link NetBpm.Workflow.Execution.IAttributeInstance}-value.
	/// </summary>
	//@portme and port docu samples.xml
	public interface ISerializer : IConfigurable //, System.Runtime.Serialization.ISerializable
	{
		/// <summary> serializes the value of an {@link NetBpm.Workflow.Execution.IAttributeInstance}
		/// to store it in the database.
		/// </summary>
		/// <param name="valueObject">is the java-object that represents the value for the {@link NetBpm.Workflow.Execution.IAttributeInstance}
		/// @throws IllegalArgumentException if object is not serializable by this serializer
		/// </param>
		String Serialize(Object valueObject);

		/// <summary> serializes the value of an {@link NetBpm.Workflow.Execution.IAttributeInstance}
		/// to store it in the database.
		/// </summary>
		/// <param name="text">text, previously generated by the serialize-method and stored in the database.
		/// </param>
		/// <returns> the java-object that represents the value for the {@link NetBpm.Workflow.Execution.IAttributeInstance}
		/// </returns>
		/// <returns> IllegalArgumentException if object is not deserializable by this serializer
		/// </returns>
		Object Deserialize(String text);
	}
}